package com.twu.biblioteca;

public class Book {
    private int number;
    private String name;
    private String author;
    private int publishedYear;
    private String libraryNumber = null;

    public Book(int number, String name, String author, int publishedYear) {
        this.number = number;
        this.name = name;
        this.author = author;
        this.publishedYear = publishedYear;
    }

    public int getNumber() {
        return this.number;
    }

    public String getName() {
        return this.name;
    }

    public String getAuthor() {
        return this.author;
    }

    public int getPublishedYear() {
        return this.publishedYear;
    }

    public void setLibraryNumber(String libraryNumber) {
        this.libraryNumber = libraryNumber;
    }

    public String getLibraryNumber() {
        return libraryNumber;
    }

    public void printInformation() {
        System.out.println(String.format("%6d    %-30s    %-20s    %-13d    %s\n", getNumber(), getName(), getAuthor(),
                getPublishedYear(), getLibraryNumber() == null ? "" : getLibraryNumber()));
    }
}
